Profiler and debugging applications are computer programs which monitor and gather information on the performance of other applications (hereinafter target applications or target processes). A profiler application may collect information from a target application to assess its execution efficiency and/or performance. For example, a profiler may identify the time, processing resources and/or memory required by a particular portion of the target application for execution. Typically, information collected by the profiler application is analyzed to identify one or more portions of the target application which may be optimized or improved.
A debugging application is typically used to test a target application and find flaws, or “bugs”, in its coded instructions. For example, when an application fails, a debugging application may be employed to identify the portion(s) (e.g., the coded routines) which caused it to do so.
In general, there are two types of profiler applications. One type, called a sampling profiler, operates by gathering data indicative of a target process's performance at predetermined intervals. A second type, called an instrumentation profiler, causes the target process to execute additional instructions provided by the profiler application to produce information indicative of the target process's performance. In general, a sampling profiler produces less specific information about a target process than an instrument profiler does, but a sampling profiler allows the target process to execute at nearly full speed. Because an instrument profiler may slow down a target process, it may produce skewed or inaccurate results.
A profiler application may operate either by creating (i.e., initiating) a target process, such that the profiling of the target process is started immediately upon initiation, or by attaching to an existing (i.e., executing) target process, such that profiling begins with the currently executing portion. A user of a profiler application may find it desirable to profile a created process if the user is unsure which portion(s) of the target process may require optimization, as creating the target process allows the profiler to gather data from the initiation of the target process. Conversely, a user may find it desirable to attach a profiler application to an existing process if a target process which had previously been functioning normally begins to run sub-optimally, so that information gathered by the profiler relates only to the portion executing poorly, and the user is not required to examine information on portions of the target process which ran normally.
When a sampling profiler application attaches to a target process, it typically allocates a specific portion of memory used by the target process, and loads a profiler agent to that allocated memory portion for execution. Because sampling profilers are designed to be unobtrusive, the target process is typically not notified that the profiler agent has been loaded to memory, or that functions enabled by the profiler agent will be initiated by the profiler application. Because of this, other applications designed to gather information on executing software applications, such as debugging applications, may not be able to gather information on the operation of the profiler agent. As such, profiler agents may be difficult to debug.